package com.dfe.backend.common.sax.scd;

import com.dfe.backend.common.sax.scd.ied.DOI;

import java.util.List;

/**
 * @author LiChang(lclicht @ qq.com)
 * @version 1.0
 * @class ScdFilter
 * @since 2023-12-8 14:38
 */
public class ScdFilter {

    /**
     * 【描述】: 筛选出dU的名称，并且排除name为Mod，desc为Mode的，dai为空的
     *
     * @param doiList doiList
     * @author LiChang
     * @since 2025-8-5 15:01
     */
    public static void filter(List<DOI> doiList) {
        doiList.removeIf(element -> ("Mod".equals(element.getName()) && "Mode".equals(element.getDesc())) || element.getDaiList() == null);
        for (DOI doi : doiList) {
            doi.getDaiList().removeIf(element -> !"dU".equals(element.getName()));
        }
    }
}
